﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ImageK.IO;
using ImageK.Process;

namespace ImageK.Plugin.Filter
{
    /** Obsolete
    * @deprecated
*/
    public class Writer : PlugInFilter
    {

        private String arg;
        private ImagePlus imp;

        public int setup(String arg, ImagePlus imp)
        {
            this.arg = arg;
            this.imp = imp;
            return BasePlugInFilter.DOES_ALL+BasePlugInFilter.NO_CHANGES;
        }

        public void run(ImageProcessor ip)
        {
            if (arg.Equals("tiff"))
                new FileSaver(imp).saveAsTiff();
            else if (arg.Equals("gif"))
                new FileSaver(imp).saveAsGif();
            else if (arg.Equals("jpeg"))
                new FileSaver(imp).saveAsJpeg();
            // else if (arg.Equals("text"))
            //     new FileSaver(imp).saveAsText();
            // else if (arg.Equals("lut"))
            //     new FileSaver(imp).saveAsLut();
            // else if (arg.Equals("raw"))
            //     new FileSaver(imp).saveAsRaw();
            // else if (arg.Equals("zip"))
            //     new FileSaver(imp).saveAsZip();
            // else if (arg.Equals("bmp"))
            //     new FileSaver(imp).saveAsBmp();
            else if (arg.Equals("png"))
                new FileSaver(imp).saveAsPng();
            else if (arg.Equals("pgm"))
                new FileSaver(imp).saveAsPgm();
            else if (arg.Equals("fits"))
                new FileSaver(imp).saveAsFits();
        }

    }
}
